package com.ljw.cube.application.controller;

import com.ljw.cube.application.entity.User;
import com.ljw.cube.application.service.UserService;
import com.ljw.common.response.CommonResponse;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@Data
@RestController
public class UserController {

    private final UserService userService;

    @GetMapping("/users")
    public CommonResponse<List<User>> getUsers() {
        log.info("getUsers()");
        List<User> list = userService.list();
        return CommonResponse.success(list);
    }
}
